<!DOCTYPE html>
<html xmlns="http://www.w3c.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:p="http://primefaces.org/ui" xmlns:pt="http://xmlns.jcp.org/jsf/passthrough" xmlns:c="http://java.sun.com/jsp/jstl/core">

<ui:decorate id="msrpDecoration" template="/resources/template/template.xhtml">

  <ui:define name="title">Carga do faturamento</ui:define>

  <ui:define name="body">

    <p:panel style="margin-bottom:20px" styleClass="fonte">

      <f:facet name="header">
        <div class="tituloCrud">Carga do faturamento</div>
      </f:facet>

      <div class="ui-messages-info ui-corner-all">
        <span class="ui-messages-info-icon"></span>
        <ul style="list-style: none;">
          <li>
            <span class="ui-messages-info-summary">Selecionar um arquivo para processamento, depois clique no botão "Carregar Arquivo", quando aparecer a mensagem "Arquivo
              carregado com sucesso", clique no botão de "Processar Carga"</span>
          </li>
        </ul>
      </div>

      <h:panelGrid columns="3">

        <h:inputFile id="file" label="Selecione o arquivo" value="#{importacaoBean.arquivo}" required="true" requiredMessage="Arquivo não selecionado.">
        </h:inputFile>

        <h:commandButton id="btnCarregar" style="margin-left:30px;" action="#{importacaoBean.carregarArquivo}" value="Carregar Arquivo" styleClass="buttonClass" />

      </h:panelGrid>

      <f:facet name="footer">
        <div style="float: right; display: block;">
          <h:panelGrid columns="4" cellpadding="15">
            <h:commandButton id="btpImportar" actionListener="#{importacaoBean.importar}" value="Processar carga" styleClass="buttonClass" immediate="true">
              <f:ajax render="frmDados:panelTemplate" execute="@this" />
            </h:commandButton>
          </h:panelGrid>

        </div>

      </f:facet>

    </p:panel>

  </ui:define>

</ui:decorate>

</html>